package immutablecar.post15;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CarDemo {
	public static void main(String[] args) {

		Car car1 = new Car("Honda", "Accord", 2013);
		Car car2 = new Car("Toyota", "Camry", 2011);
		Car car3 = new Car("Mercedez", "Benz", 2014);
		Car car4 = new Car("Toyota", "Camry", 2013);
		
		System.out.println("car2.equals(car4)" + car2.equals(car4));


//		System.out.println(car1);
//		System.out.println(car2);
//		System.out.println(car3);

		List<Car> carObjects = new ArrayList<Car>();

		carObjects.add(car1);
		carObjects.add(car2);
		carObjects.add(car3);
		carObjects.add(car4);

		for (Car carObject : carObjects) {
			System.out.println("Make Of Car =" + carObject.getMake());
			System.out.println("Model Of Car =" + carObject.getModel());
			System.out.println("Year Of Car =" + carObject.getYear());
			

		}
		
		
	}

}
